<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Blog</title>
		<link rel="stylesheet" href="/stylesheets/style.css">
		<script charset="utf-8" src="/kindeditor/kindeditor-min.js"></script>
		<script charset="utf-8" src="/kindeditor/lang/zh_CN.js"></script>
		<script>
			var editor;
			KindEditor.ready(function(K) {
			  //window.editor = K.create('#kindeditor');
			  editor = K.create('textarea', {
			  allowImageUpload : false,
			  items : [
			    'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic',
			    'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright',
			    'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link']
			  });
			});
		</script>
	</head>
	<body>
		<header>
			<h1><%= title %></h1>
		</header>
		
		<nav>
			<span><a title="主页" href="/">home</a></span>
			<span><a title="存档" href="/archive">archive</a></span>
			<span><a title="标签" href="/tags">tags</a></span>
			<span><a title="友情链接" href="/links">links</a></span>
			<% if(user){ %>
				<span><a title="发表" href="/posts/new">post</a></span>
				<span><a title="登出" href="/signout">signout</a></span>
			<% }else{ %>
				<span><a title="登录" href="/signin">signin</a></span>
				<span><a title="注册" href="/signup">signup</a></span>
			<% } %>
			<span><form action="/posts/search" method="GET"><input type="text" name="keyword" placeholder="SEARCH" class="search" /></form></span>
		</nav>

		<article>
			<% if (success) { %>
			  <div><%= success %></div>
			<% } %>
			<% if (error) { %>
			  <div><%= error %> </div>
			<% } %>
